There is a train connection between Gulbene and Riga, but fewer services run than by bus.
Several buses leave from Riga each day to Gulbene. Trip times vary, but it generally takes about 3 hours.